<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Git," />





  <link rel="alternate" href="/atom.xml" title="微凉的博客" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?v=5.1.2" />






<meta name="description" content="Git 是什么Git是一种版本控制工具 版本控制工具对于开发来说主要的功能 管理源代码（方便成员之间的协作开发–代码的合并） 维护所有代码的历史记录版本控制概述本地版本控制集中版本控制分布式版本控制Git环境安装 window安装   下载地址，下载后和普通软件安装方式一样   linux安装   CentOS发行版：sudo yum install git Ubuntu发行版：sudo apt-">
<meta name="keywords" content="Git">
<meta property="og:type" content="article">
<meta property="og:title" content="Git基础">
<meta property="og:url" content="http://yoursite.com/2017/09/14/Git基础 201709141747/index.html">
<meta property="og:site_name" content="微凉的博客">
<meta property="og:description" content="Git 是什么Git是一种版本控制工具 版本控制工具对于开发来说主要的功能 管理源代码（方便成员之间的协作开发–代码的合并） 维护所有代码的历史记录版本控制概述本地版本控制集中版本控制分布式版本控制Git环境安装 window安装   下载地址，下载后和普通软件安装方式一样   linux安装   CentOS发行版：sudo yum install git Ubuntu发行版：sudo apt-">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://img.blog.csdn.net/20170913173459553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914154929825?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914161913156?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914165524726?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914165547304?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914173802814?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20170914174527055?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2017-09-14T09:50:32.980Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Git基础">
<meta name="twitter:description" content="Git 是什么Git是一种版本控制工具 版本控制工具对于开发来说主要的功能 管理源代码（方便成员之间的协作开发–代码的合并） 维护所有代码的历史记录版本控制概述本地版本控制集中版本控制分布式版本控制Git环境安装 window安装   下载地址，下载后和普通软件安装方式一样   linux安装   CentOS发行版：sudo yum install git Ubuntu发行版：sudo apt-">
<meta name="twitter:image" content="http://img.blog.csdn.net/20170913173459553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/09/14/Git基础 201709141747/"/>







  <title>Git基础 | 微凉的博客</title>
  














</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">微凉的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/404/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
            
            公益404
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/09/14/Git基础 201709141747/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="微凉">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="微凉的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Git基础</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-14T17:47:43+08:00">
                2017-09-14
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
            </span>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="Git-是什么"><a href="#Git-是什么" class="headerlink" title="Git 是什么"></a>Git 是什么</h2><p>Git是一种版本控制工具</p>
<h2 id="版本控制工具对于开发来说主要的功能"><a href="#版本控制工具对于开发来说主要的功能" class="headerlink" title="版本控制工具对于开发来说主要的功能"></a>版本控制工具对于开发来说主要的功能</h2><ol>
<li>管理源代码（方便成员之间的协作开发–代码的合并）</li>
<li>维护所有代码的历史记录<h2 id="版本控制概述"><a href="#版本控制概述" class="headerlink" title="版本控制概述"></a>版本控制概述</h2>本地版本控制<br>集中版本控制<br>分布式版本控制<h2 id="Git环境安装"><a href="#Git环境安装" class="headerlink" title="Git环境安装"></a>Git环境安装</h2><ul>
<li>window安装</li>
</ul>
<ul>
<li><a href="http://git-scm.com/download/win" target="_blank" rel="external">下载地址</a>，下载后和普通软件安装方式一样</li>
</ul>
<ul>
<li>linux安装</li>
</ul>
<ul>
<li>CentOS发行版：sudo yum install git</li>
<li>Ubuntu发行版：sudo apt-get install git</li>
</ul>
<ul>
<li>Mac安装</li>
</ul>
<ul>
<li>打开Terminal直接输入git命令，会自动提示，按提示引导安装即可</li>
</ul>
</li>
</ol>
<h2 id="Git工作原理"><a href="#Git工作原理" class="headerlink" title="Git工作原理"></a>Git工作原理</h2><h4 id="Git的三个工作区域"><a href="#Git的三个工作区域" class="headerlink" title="Git的三个工作区域"></a>Git的三个工作区域</h4><ul>
<li>工作目录(当前代码所在的位置)</li>
<li>暂存区域(工作目录的文件一旦加到暂存区就会被git管理)</li>
<li>本地仓库(完成功能的代码提交到这里)<br><img src="http://img.blog.csdn.net/20170913173459553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></li>
</ul>
<h3 id="Git管理文件的4中状态"><a href="#Git管理文件的4中状态" class="headerlink" title="Git管理文件的4中状态"></a>Git管理文件的4中状态</h3><ul>
<li>未追踪untraced（没有被git管理的文件，新创建的文件）位于工作目录</li>
<li>已暂存staged（一般用于存储半成品）位于暂存区</li>
<li>已提交commited（一般存储成品，一次阶段性成果会commit一次）位于本地仓库</li>
<li>已修改modified（位于暂存区中的代码又被修改了）位于工作目录</li>
</ul>
<h2 id="Git工作流程-本地创建仓库"><a href="#Git工作流程-本地创建仓库" class="headerlink" title="Git工作流程-本地创建仓库"></a>Git工作流程-本地创建仓库</h2><hr>
<p> 1) 配置用户信息<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">git config --global user.name zhangsan   </div><div class="line"></div><div class="line">&gt; 设置用户名</div><div class="line"></div><div class="line">git config --global user.email zhangsan@itcast.cn</div><div class="line"></div><div class="line">&gt; 设置用户邮箱</div></pre></td></tr></table></figure></p>
<p> 2)    初始化仓库<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git init</div></pre></td></tr></table></figure></p>
<p> 3) 查看仓库中所有的文件状态<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git status</div></pre></td></tr></table></figure></p>
<p> 4) 把工作目录中的文件添加到暂存区</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">git add 文件列表</div><div class="line">&gt; 或者</div><div class="line">git add *</div><div class="line">&gt; 添加文件夹内所有的文件</div></pre></td></tr></table></figure>
<p> 5.)把暂存区中的代码添加到本地仓库<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git commit -m 备注信息</div></pre></td></tr></table></figure></p>
<p> 6.)查看文件信息</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git log</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20170914154929825?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h3 id="Git-命令的回滚操作"><a href="#Git-命令的回滚操作" class="headerlink" title="Git 命令的回滚操作"></a>Git 命令的回滚操作</h3><ul>
<li>删除暂存区指定的文件</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git rm --cached（要删除的文件名称）</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20170914161913156?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<ul>
<li>回滚操作</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">git reset (后面有三个参数 分别为)</div><div class="line">git reset --hard （后面跟你要回滚到的那个commitID的值）</div><div class="line">&gt; 回滚本地仓库的快照；使用本地仓库快照覆盖暂存区；使用本地仓库快照覆盖工作目录</div><div class="line"></div><div class="line"></div><div class="line">git reset --soft （后面跟你要回滚到的那个commitID的值）</div><div class="line">&gt; 只回滚本地仓库的快照</div><div class="line"></div><div class="line">git reset --mixed(默认的参数 后面跟你要回滚到的那个commitID的值）</div><div class="line">&gt; 回滚本地仓库的快照 并且 覆盖暂存区，但是不覆盖工作目录</div></pre></td></tr></table></figure>
<hr>
<ul>
<li>git reset –hard演示（其余同理）</li>
</ul>
<p><img src="http://img.blog.csdn.net/20170914165524726?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><img src="http://img.blog.csdn.net/20170914165547304?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<hr>
<p><strong>其实如下3个命令等效（使用最新的本地仓库快照覆盖暂存区）</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git reset HEAD （HEAD就是最新的commitID）</div></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git reset --mixed 最新commitID</div></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git reset 最新commitID</div></pre></td></tr></table></figure>
<hr>
<ul>
<li>回滚所有的修改操作(还未上传到缓存区的时候用的命令即为使用暂存区覆盖工作目录)</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git checkout .</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20170914173802814?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><strong>如果只要恢复特定文件的内容 那么可以这样写</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git checkout -- （写要恢复的文件的名称）</div></pre></td></tr></table></figure>
<blockquote>
<p>本地操作常用的命令总结<br><img src="http://img.blog.csdn.net/20170914174527055?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTDIyMDUzMDY3NDQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
</blockquote>

      
    </div>
    
    
    



    



    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>Donate</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="http://ovi21695e.bkt.clouddn.com/wechat.png" alt="微凉 WeChat Pay"/>
        <p>WeChat Pay</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="http://ovi21695e.bkt.clouddn.com/zhifubao.png" alt="微凉 Alipay"/>
        <p>Alipay</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Git/" rel="tag"><i class="fa fa-tag"></i> Git</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/13/Linux(bash)简单的命令介绍 2017090132222/" rel="next" title="Linux(bash)简单的命令介绍">
                <i class="fa fa-chevron-left"></i> Linux(bash)简单的命令介绍
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/14/Git基础-分支的基本操作 201709142054/" rel="prev" title="Git基础-分支">
                Git基础-分支 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
  <a class="jiathis_button_tsina"></a>
  <a class="jiathis_button_tqq"></a>
  <a class="jiathis_button_weixin"></a>
  <a class="jiathis_button_cqq"></a>
  <a class="jiathis_button_douban"></a>
  <a class="jiathis_button_renren"></a>
  <a class="jiathis_button_qzone"></a>
  <a class="jiathis_button_kaixin001"></a>
  <a class="jiathis_button_copy"></a>
  <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
  <a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
  var jiathis_config={
    hideMore:false
  }
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->

      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zMDQ5NC83MDQ4"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.png"
               alt="微凉" />
          <p class="site-author-name" itemprop="name">微凉</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">2</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              推荐阅读
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.uisdc.com/" title="优设" target="_blank">优设</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://mlizheng.github.io/TIME/" title="李征" target="_blank">李征</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.alloyteam.com/nav/" title="Web前端导航" target="_blank">Web前端导航</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.36zhen.com/t?id=3448" title="前端书籍资料" target="_blank">前端书籍资料</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://ife.baidu.com/" title="百度前端技术学院" target="_blank">百度前端技术学院</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://wf.uisdc.com/cn/" title="google前端开发基础" target="_blank">google前端开发基础</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Git-是什么"><span class="nav-number">1.</span> <span class="nav-text">Git 是什么</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#版本控制工具对于开发来说主要的功能"><span class="nav-number">2.</span> <span class="nav-text">版本控制工具对于开发来说主要的功能</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#版本控制概述"><span class="nav-number">3.</span> <span class="nav-text">版本控制概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Git环境安装"><span class="nav-number">4.</span> <span class="nav-text">Git环境安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Git工作原理"><span class="nav-number">5.</span> <span class="nav-text">Git工作原理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Git的三个工作区域"><span class="nav-number">5.0.1.</span> <span class="nav-text">Git的三个工作区域</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git管理文件的4中状态"><span class="nav-number">5.1.</span> <span class="nav-text">Git管理文件的4中状态</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Git工作流程-本地创建仓库"><span class="nav-number">6.</span> <span class="nav-text">Git工作流程-本地创建仓库</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Git-命令的回滚操作"><span class="nav-number">6.1.</span> <span class="nav-text">Git 命令的回滚操作</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  1996 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-hand-o-right" aria-hidden="true"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">微凉</span>
</div>


<!-- <div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

-->

        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>


        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.2"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  






  





  

  

  

  

  

  

</body>
</html>
